Skip to main content
Format conversion utilities for transforming GDAL-supported rasters into specialized planetary science and 3D formats.

Overview

These tools enable conversion from standard geospatial formats (GeoTIFF, etc.) to specialized formats used in planetary science, 3D visualization, and archival systems.

ISIS3 Conversion

Astropedia_gdal2ISIS3.py

Creates ISIS3-compatible cube files (raw with ISIS3 label) from any GDAL-supported image.
infile
string
required
Path to input GDAL-supported raster
outfile
string
required
Path to output ISIS3 cube file (.cub)
-debug
flag
default:"false"
Print detailed image information during conversion
-noimage
flag
default:"false"
Generate only the .lbl label file without the image data
-attach
flag
default:"false"
Attach the label to the ISIS image (requires ISIS3 installation)
-force360
flag
default:"false"
Force longitude system to 360-degree domain
-centerLon
float
Override the center longitude value
-base
float
Set the base offset for pixel values
-multiplier
float
Set the scaling multiplier for pixel values
Usage:
python Astropedia_gdal2ISIS3.py [options] infile output.cub
Examples:
python Astropedia_gdal2ISIS3.py mars_dem.tif mars_dem.cub
Currently works only for a limited set of images. Verify output for your specific use case.

LMMP_gdal2PDS.py

Simple brute-force script to convert from GDAL-supported formats to PDS3 images with labels. Purpose: Generate PDS3-compliant image files for planetary data archiving. Usage:
python LMMP_gdal2PDS.py infile outfile.img
PDS3 (Planetary Data System version 3) is a NASA standard for archiving and distributing planetary science data.

3D Mesh Conversion

gdal2PLY.py

Generate triangulated 3D mesh (PLY format) from digital elevation models (DEMs).
inputfile
string
required
Path to input DEM raster
outputfile
string
required
Path to output .ply mesh file
Usage:
python gdal2PLY.py inputfile.tif outputfile.ply
Example:
python gdal2PLY.py crater_dem_10m.tif crater_mesh.ply

How It Works

1

Read DEM elevation data

Load the entire raster into a NumPy array
2

Create vertex array

Generate 3D vertices (X, Y, Z) for each pixel using geotransformation
3

Build triangle index

Create face indices connecting adjacent vertices in a triangulated mesh
4

Write PLY file

Export vertices and faces in binary PLY format for efficient storage

NoData Handling

The script does not automatically handle NoData values. Use this workaround:
1

Find minimum elevation

gdalinfo -mm input_DEM.tif
Example output: Computed Min/Max=-2790.594, 1234.567
2

Set NoData to safe value

Round down from minimum and optionally resample:
gdalwarp -dstnodata -2791 -tr 10 10 -r bilinear \
  input_DEM.tif output_DEM_10m_nodata.tif
3

Convert to PLY

python gdal2PLY.py output_DEM_10m_nodata.tif output_mesh.ply

PLY Format

The output PLY (Polygon File Format) is a widely-supported 3D mesh format:
  • Binary format: Efficient storage (default)
  • Contains: Vertex positions (X, Y, Z) and triangle face definitions
  • Compatible with: MeshLab, Blender, CloudCompare, and many 3D viewers

Requirements

pip install gdal
# Optional: ISIS3 for -attach flag

Output File Structures

ISIS3 Cube (.cub)

ISIS3 cubes consist of:

Label Section

PVL (Parameter Value Language) metadata describing:
  • Image dimensions and data type
  • Projection and coordinate system
  • Pixel scaling (base + multiplier)
  • Processing history

Image Data

Raw binary raster data:
  • Tile or band-sequential organization
  • Native byte order
  • Optional compression

PLY Mesh

ply
format binary_little_endian 1.0
element vertex 262144
property float x
property float y
property float z
element face 261121
property list int int vertex_index
end_header
[binary vertex data]
[binary face index data]

Use Cases

ISIS3 Processing

Ingest data into USGS ISIS3 for planetary image processing pipelines

PDS Archiving

Prepare datasets for submission to NASA’s Planetary Data System

3D Visualization

Create interactive 3D terrain meshes from elevation data

Data Sharing

Convert to formats compatible with legacy planetary software

Quality Assurance

Inspect DEMs in 3D mesh viewers for artifacts and anomalies

Web Publishing

Generate lightweight meshes for web-based 3D viewers

Credits

  • ISIS3 scripts: Trent Hare, USGS (thare@usgs.gov)
  • gdal2PLY.py: Based on work by Jake (GIS StackExchange), modified by Trent Hare
  • Original gdalinfo.py authors: Even Rouault, Frank Warmerdam
These tools are provided as-is for planetary science workflows. Always validate output before use in production systems.